package com.xing.binbackend.pattern.factory12.ecommerce;

// 3. 支付工厂（核心工厂）
public class PaymentFactory {
    public static Payment createPayment(String type) {
        switch (type.toLowerCase()) {
            case "wechat": return new WechatPay();
            case "alipay": return new Alipay();
            default: throw new IllegalArgumentException("不支持的支付类型");
        }
    }
}